var status = -1;
var selectionLog = [];

function start(d, c, b) {
    if (status == 0 && d == 0) {
        qm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status == a++) {
            qm.setAmbience("Ambience.img/warning", 100, 60);
            qm.updateInfoQuest(33188, "kill=Noclear");
            qm.curNodeEventEnd(true);
            qm.setInGameDirectionMode(true, false, true);
            qm.inGameDirectionEvent_SetHideEffect(0);
            qm.inGameDirectionEvent_MoveAction(2);
            qm.inGameDirectionEvent_AskAnswerTime(10)
        } else {
            if (status === a++) {
                qm.inGameDirectionEvent_MoveAction(0);
                qm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection();
                qm.inGameDirectionEvent_AskAnswerTime(1000)
            } else {
                if (status === a++) {
                    qm.inGameDirectionEvent_PushScaleInfo(500, 1500, 500, -3, -157)
                } else {
                    if (status === a++) {
                        qm.inGameDirectionEvent_AskAnswerTime(2000)
                    } else {
                        if (status === a++) {
                            qm.inGameDirectionEvent_AskAnswerTime(200)
                        } else {
                            if (status === a++) {
                                qm.userSetFieldFloating(350031600, 5, 5, 20);
                                qm.inGameDirectionEvent_AskAnswerTime(500);
                                qm.effect_Voice("SoundEff.img/blackHeaven/explosion1", 100)
                            } else {
                                if (status === a++) {
                                    qm.userSetFieldFloating(350031600, 2, 2, 20);
                                    qm.inGameDirectionEvent_AskAnswerTime(50)
                                } else {
                                    if (status === a++) {
                                        qm.onCameraTilt(15, 5000);
                                        qm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/tilt", 100);
                                        qm.npc_SetSpecialAction("oid=22427029", "left", 0, 1);
                                        qm.fieldEffect_PlayFieldSound("BlackHeaven/7", 100);
                                        qm.inGameDirectionEvent_AskAnswerTime(2000)
                                    } else {
                                        if (status === a++) {
                                            qm.addPopupSay(1540617, 1000, "没时间犹豫了!请握住船舵!", "", 0);
                                            qm.inGameDirectionEvent_AskAnswerTime(2000)
                                        } else {
                                            if (status === a++) {
                                                qm.userSetFieldFloating(350031600, 0, 0, 0);
                                                qm.inGameDirectionEvent_AskAnswerTime(50)
                                            } else {
                                                if (status === a++) {
                                                    qm.onTeleport(0, 3, qm.getPlayer().getId(), -4, -150);
                                                    qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                } else {
                                                    if (status === a++) {
                                                        qm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
                                                        qm.inGameDirectionEvent_AskAnswerTime(200)
                                                    } else {
                                                        if (status === a++) {
                                                            qm.inGameDirectionEvent_PushScaleInfo(0, 2000, 0, -3, -157)
                                                        } else {
                                                            if (status === a++) {
                                                                qm.inGameDirectionEvent_SetHideEffect(1);
                                                                qm.inGameDirectionEvent_AskAnswerTime(200)
                                                            } else {
                                                                if (status === a++) {
                                                                    qm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 0, 0);
                                                                    qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                } else {
                                                                    if (status === a++) {
                                                                        qm.addPopupSay(1540617, 1000, "请把船舵转向右侧!", "", 0);
                                                                        qm.inGameDirectionEvent_QTE(5)
                                                                    } else {
                                                                        if (status === a++) {
                                                                            qm.npc_SetSpecialAction("oid=22427029", "right", 0, 1);
                                                                            qm.fieldEffect_PlayFieldSound("BlackHeaven/7", 100);
                                                                            qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                        } else {
                                                                            if (status === a++) {
                                                                                qm.userSetFieldFloating(350031600, 2, 2, 20);
                                                                                qm.onCameraTilt(-7, 3500);
                                                                                qm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/tilt", 100);
                                                                                qm.inGameDirectionEvent_AskAnswerTime(3500)
                                                                            } else {
                                                                                if (status === a++) {
                                                                                    qm.userSetFieldFloating(350031600, 0, 0, 0);
                                                                                    qm.inGameDirectionEvent_AskAnswerTime(50)
                                                                                } else {
                                                                                    if (status === a++) {
                                                                                        qm.addPopupSay(1540617, 1000, "反方向!请向反方向转动!", "", 0);
                                                                                        qm.inGameDirectionEvent_QTE(6)
                                                                                    } else {
                                                                                        if (status === a++) {
                                                                                            qm.npc_SetSpecialAction("oid=22427029", "left", 0, 1);
                                                                                            qm.fieldEffect_PlayFieldSound("BlackHeaven/7", 100);
                                                                                            qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                                        } else {
                                                                                            if (status === a++) {
                                                                                                qm.userSetFieldFloating(350031600, 2, 2, 20);
                                                                                                qm.onCameraTilt(5, 2000);
                                                                                                qm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/tilt", 100);
                                                                                                qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                                            } else {
                                                                                                if (status === a++) {
                                                                                                    qm.userSetFieldFloating(350031600, 0, 0, 0);
                                                                                                    qm.inGameDirectionEvent_AskAnswerTime(50)
                                                                                                } else {
                                                                                                    if (status === a++) {
                                                                                                        qm.addPopupSay(1540617, 1000, "差不多了!\r\n重新往反方向转动!", "", 0);
                                                                                                        qm.inGameDirectionEvent_QTE(5)
                                                                                                    } else {
                                                                                                        if (status === a++) {
                                                                                                            qm.npc_SetSpecialAction("oid=22427029", "right", 0, 1);
                                                                                                            qm.fieldEffect_PlayFieldSound("BlackHeaven/7", 100);
                                                                                                            qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                                                        } else {
                                                                                                            if (status === a++) {
                                                                                                                qm.userSetFieldFloating(350031600, 2, 2, 20);
                                                                                                                qm.onCameraTilt(0, 1500);
                                                                                                                qm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/tilt", 100);
                                                                                                                qm.inGameDirectionEvent_AskAnswerTime(1000)
                                                                                                            } else {
                                                                                                                if (status === a++) {
                                                                                                                    qm.userSetFieldFloating(350031600, 0, 0, 0);
                                                                                                                    qm.inGameDirectionEvent_AskAnswerTime(50)
                                                                                                                } else {
                                                                                                                    if (status === a++) {
                                                                                                                        qm.playSoundEffDirectly("Ambience.img/warning");
                                                                                                                        qm.inGameDirectionEvent_AskAnswerTime(3000)
                                                                                                                    } else {
                                                                                                                        if (status === a++) {
                                                                                                                            qm.addPopupSay(1540617, 1000, "很好, 现在已经稳定了. ", "", 0);
                                                                                                                            qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                                                                        } else {
                                                                                                                            if (status === a++) {
                                                                                                                                qm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
                                                                                                                                qm.npc_ChangeController(1540457, "oid=22430986", -456, -31, 14, -506, -406, 0, true, 0, false);
                                                                                                                                qm.npc_SetSpecialAction("oid=22430986", "summon", 0, 0);
                                                                                                                                qm.npc_SetForceMove("oid=22430986", 1, 300, 100);
                                                                                                                                qm.inGameDirectionEvent_AskAnswerTime(200)
                                                                                                                            } else {
                                                                                                                                if (status === a++) {
                                                                                                                                    qm.inGameDirectionEvent_PushScaleInfo(0, 1500, 0, -3, -50)
                                                                                                                                } else {
                                                                                                                                    if (status === a++) {
                                                                                                                                        qm.inGameDirectionEvent_SetHideEffect(0);
                                                                                                                                        qm.inGameDirectionEvent_AskAnswerTime(200)
                                                                                                                                    } else {
                                                                                                                                        if (status === a++) {
                                                                                                                                            qm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 0, 0);
                                                                                                                                            qm.inGameDirectionEvent_AskAnswerTime(1000)
                                                                                                                                        } else {
                                                                                                                                            if (status === a++) {
                                                                                                                                                qm.sendNormalTalk_Bottom("#ho#，是你控制了船舵啊！", 37, 1540457, false, true)
                                                                                                                                            } else {
                                                                                                                                                if (status === a++) {
                                                                                                                                                    qm.sendNormalTalk_Bottom("真是太好了。现在这里就交给我吧。", 37, 1540457, true, true)
                                                                                                                                                } else {
                                                                                                                                                    if (status === a++) {
                                                                                                                                                        qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                                                                                                    } else {
                                                                                                                                                        if (status === a++) {
                                                                                                                                                            qm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 500, 0);
                                                                                                                                                            qm.inGameDirectionEvent_AskAnswerTime(500)
                                                                                                                                                        } else {
                                                                                                                                                            if (status === a++) {
                                                                                                                                                                qm.npc_LeaveField("oid=22430986");
                                                                                                                                                                qm.npc_LeaveField("oid=22430986");
                                                                                                                                                                qm.fieldEffect_KinesisEXP(Math.pow(qm.getLevel(), 3) / 4);
                                                                                                                                                                qm.forceCompleteQuest(33172);
                                                                                                                                                                qm.gainExp(Math.pow(qm.getLevel(), 3) / 4);
                                                                                                                                                                qm.inGameDirectionEvent_AskAnswerTime(3000);
                                                                                                                                                                qm.effect_Voice("Field.img/masteryBook/EnchantSuccess", 100)
                                                                                                                                                            } else {
                                                                                                                                                                if (status === a++) {
                                                                                                                                                                    qm.dispose();
                                                                                                                                                                    qm.warp(350031501, 0, true);
                                                                                                                                                                    qm.setInGameDirectionMode(false, true, false)
                                                                                                                                                                }
                                                                                                                                                            }
                                                                                                                                                        }
                                                                                                                                                    }
                                                                                                                                                }
                                                                                                                                            }
                                                                                                                                        }
                                                                                                                                    }
                                                                                                                                }
                                                                                                                            }
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

function stage0(d, c, b) {
    if (status == 0 && d == 0) {
        qm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status == a++) {
            var e = qm.getQuest();
            qm.askYesNo("这个任务的依次对话脚本还没有修复哦。它的脚本位于： #b 脚本/任务/33187.js#k\r\n\r\n如果你有兴趣，欢迎一起来修复！\r\n\r\n那么现在，你要立刻开始这个任务吗？")
        } else {
            if (status == a++) {
                qm.forceStartQuest();
                qm.dispose()
            }
        }
    }
}

function end(d, c, b) {
    if (status == 0 && d == 0) {
        qm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status == a++) {
            var e = qm.getQuest();
            qm.askYesNo("这个任务的结束脚本还没有修复哦。它的脚本位于： #b /脚本/任务/#e" + e + "#n.js#k\r\n\r\n如果你有兴趣，欢迎一起来修复！\r\n\r\n那么现在，你要立刻完成这个任务吗？")
        } else {
            if (status == a++) {
                qm.forceCompleteQuest();
                qm.dispose()
            }
        }
    }
};